package com.simon.hse.activity.safe.workpermit;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.simon.hse.R;
import com.simon.hse.activity.BaseActivity;
import com.simon.hse.activity.safe.jobticket.blind.BlindQueryListActivity;
import com.simon.hse.activity.safe.jobticket.breakage.BreakageQueryListActivity;
import com.simon.hse.activity.safe.jobticket.commonly.CommonlyCancelQueryListActivity;
import com.simon.hse.activity.safe.jobticket.earth.EarthQueryListActivity;
import com.simon.hse.activity.safe.jobticket.electric.ElectricQueryListActivity;
import com.simon.hse.activity.safe.jobticket.fire.FireQueryListActivity;
import com.simon.hse.activity.safe.jobticket.high.HighQueryListActivity;
import com.simon.hse.activity.safe.jobticket.limited.LimitedQueryListActivity;
import com.simon.hse.activity.safe.jobticket.lock.LockApplyActivity;
import com.simon.hse.activity.safe.jobticket.lock.LockQueryListActivity;
import com.simon.hse.activity.safe.jobticket.nolock.NoLockQueryListActivity;
import com.simon.hse.activity.safe.jobticket.pipeline.PipelineQueryListActivity;
import com.simon.hse.activity.safe.jobticket.simple.SimpleCancelQueryListActivity;
import com.simon.hse.activity.safe.jobticket.simple.SimpleQueryListActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * 作业许可证取消查询
 */
@ContentView(R.layout.activity_work_permit_cancel_query)
public class WorkPermitCancelQueryActivity extends BaseActivity {
    @ViewInject(R.id.tv_common_title)
    TextView mTv_common_title;
    String type;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        type = getIntent().getStringExtra("type");
        switch (type) {
            case "workPermit":
                mTv_common_title.setText("作业许可证取消查询");
                break;
            case "commonly":
                mTv_common_title.setText("一般吊装作业许可证取消查询");
                break;
            case "simple":
                mTv_common_title.setText("简易吊装作业许可证管理");
                break;
            case "fire":
                mTv_common_title.setText("动火作业许可证取消查询");
                break;
            case "earth":
                mTv_common_title.setText("动土作业许可证取消查询");
                break;
            case "breakage":
                mTv_common_title.setText("断路作业许可证取消查询");
                break;
            case "high":
                mTv_common_title.setText("高处作业许可证取消查询");
                break;
            case "pipeline":
                mTv_common_title.setText("管线作业许可证取消查询");
                break;
            case "electric":
                mTv_common_title.setText("临电作业许可证取消查询");
                break;
            case "blind":
                mTv_common_title.setText("盲板作业许可证取消查询");
                break;
            case "limited":
                mTv_common_title.setText("受限空间作业许可证取消查询");
                break;
            case "lock":
                mTv_common_title.setText("上锁挂签作业许可证取消查询");
                break;
            case "noLock":
                mTv_common_title.setText("挂签免锁作业许可证取消查询");
                break;
//            default:
//                mTv_common_title.setText("作业许可证取消查询");
//                break;
        }
    }

    @Event(value = {R.id.iv_common_left, R.id.tv_permit_cancel_query})
    private void onClick(View view) {
        switch (view.getId()) {
            case R.id.iv_common_left:
                finish();
                break;
            case R.id.tv_permit_cancel_query:
                Intent intent = new Intent();
                switch (type) {
                    case "workPermit":
                        intent.setClass(WorkPermitCancelQueryActivity.this, WorkPermitCancelListlActivity.class);
                        break;
                    case "commonly":
                        intent.setClass(WorkPermitCancelQueryActivity.this, CommonlyCancelQueryListActivity.class);
                        break;
                    case "simple":
                        intent.setClass(WorkPermitCancelQueryActivity.this, SimpleCancelQueryListActivity.class);
                        break;
                    case "fire":
                        intent.setClass(WorkPermitCancelQueryActivity.this, FireQueryListActivity.class);
                        break;
                    case "earth":
                        intent.setClass(WorkPermitCancelQueryActivity.this, EarthQueryListActivity.class);
                        break;
                    case "breakage":
                        intent.setClass(WorkPermitCancelQueryActivity.this, BreakageQueryListActivity.class);
                        break;
                    case "high":
                        intent.setClass(WorkPermitCancelQueryActivity.this, HighQueryListActivity.class);
                        break;
                    case "pipeline":
                        intent.setClass(WorkPermitCancelQueryActivity.this, PipelineQueryListActivity.class);
                        break;
                    case "electric":
                        intent.setClass(WorkPermitCancelQueryActivity.this, ElectricQueryListActivity.class);
                        break;
                    case "blind":
                        intent.setClass(WorkPermitCancelQueryActivity.this, BlindQueryListActivity.class);
                        break;
                    case "limited":
                        intent.setClass(WorkPermitCancelQueryActivity.this, LimitedQueryListActivity.class);
                        break;
                    case "lock":
                        intent.setClass(WorkPermitCancelQueryActivity.this, LockQueryListActivity.class);
                        break;
                    case "noLock":
                        intent.setClass(WorkPermitCancelQueryActivity.this, NoLockQueryListActivity.class);
                        break;
                }
                startActivity(intent);
                finish();
                break;
        }
    }
}
